<?php
/**
 * beimuaihui System
 * Copyright(c) 2011-2020 beimuaihui.
 * @license    http://www.gnu.org/licenses/gpl.html     This software Under GPL V3 License 
 * beimuaihui@gmail.com
 * http://code.google.com/p/beimuaihui/
 * $Id: Content.php 262 2011-07-23 15:51:14Z beimuaihui $
 */


Zend_Loader::loadClass("Baogg_Db_Table");

//class Permission extends Baogg_Db_Table {
class Content  extends Baogg_Db_Table {
	/**
	 * The default table name 
	 */
	protected $_name;
	protected $_db ;
	protected $_primary; 
	
	function __construct() {
		$this->_name =   'content';
		$this->myPrimary= $this->_primary='content_id';
		parent::__construct();
	}
	
	/*
	 *   get  data list
	 */
	

	/*
	 * Get All by state
	 */	
	

	/*
	 * Get category list unless a category . defaut is unless english
	 */
	
	
	
	
	 

	
	

	
     
	

	function getSame($arr) {	
		$ret=array();
		
		$where=array(" title ='{$arr['title']}'");
		if(isset($arr[$this->myPrimary])){
			$where[]=" $this->myPrimary !='{$arr[$this->myPrimary]}'";
		}
	    $sql = "SELECT {$this->myPrimary} FROM {$this->_name} WHERE  ".implode(" and ",$where);
	    
		//var_dump($arr);var_dump($this->myPrimary); echo $sql;exit;
		$rs = $this->_db->query($sql)->fetchAll();
		foreach((array)$rs as $v)
		{
		    $ret[]=$v[$this->myPrimary];
		}
		return $ret; 	
	
	}
	
    
    
}
